﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using ViCode_LeVi.Data;
using ViCode_LeVi.Reports;

namespace ViCode_LeVi.Controls
{
    /// <summary>
    /// Interaction logic for VMTabImages.xaml
    /// </summary>
    public partial class VMTabImages : UserControl
    {
        public VMTabImages()
        {
            InitializeComponent();
            this.Loaded += new RoutedEventHandler(VMTabImages_Loaded);
        }

        void VMTabImages_Loaded(object sender, RoutedEventArgs e)
        {
           // UserControl_Images_Main.RefreshImage();
            VMTabImages_Item_1.LoadImage();
            VMTabImages_Item_2.LoadImage();
            VMTabImages_Item_3.LoadImage();
            VMTabImages_Item_4.LoadImage();
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Report_Image rep = new Report_Image();
            var _imageinfo = ProjectData.Intance.ImageInfos.Where(i => i != null && i.Info != null);
            object datasource = ProjectData.Intance.ImageInfos;
            //if (_imageinfo != null)
            //    datasource = _imageinfo.Select(i => i.Info).ToArray();
            frmViewReport frm = new frmViewReport(rep, datasource);
            frm.Show();
        }
    }
}
